#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	double s = 0, flag=1;
	int i, n = 40;
	for (i = 1; i <= n; i++)
	{
		s = s + flag/i;
		flag = -1 * flag;
	}
	printf("1-1/2+1/3-1/4..+n = %lf\n", s);
}